<template>
	<view>
		<!-- #ifdef APP-PLUS -->
		<Hearder :name="'好友明细'"></Hearder>
		<!-- #endif -->
		
		<u-transition :show="show">
			<view class="content">
				<view class="shurucon">
					<u-icon name="search" color="#ccc" size="24"></u-icon>
					<input type="text" placeholder="请输入会员手机号" placeholder-style="color:#ccc;" v-model="search"/>
					<view class="box_search" @click="btnsearch">搜索</view>
				</view>
				<view class="list-con">
					<view class="every" v-if="loading" v-for="item in 2">
						<view class="">
							<u-skeleton
								rows="1"
								:title="false"
								:loading="loading"
								:rowsWidth="['100%']"
								:rowsHeight="['50rpx']"
								animate
								avatar>
							</u-skeleton>
						</view>
						<u-skeleton
							rows="1"
							:title="false"
							:loading="loading"
							:rowsWidth="['100%']"
							:rowsHeight="['50rpx']"
							animate>
						</u-skeleton>
					</view>
					<view class="every" v-if="!loading &&listData.length>0" v-for="item in listData" :key="item.member_id">
						<view class="clearfix">
							<image :src="item.avatarUrl"></image>
							<view>
								<view>{{item.name}}<text>({{item.member_id}})</text></view>
								<view>{{item.phone}}</view>
							</view>
						</view>
						<view class="cont_a_col" @click="goPage('charge?member_id='+item.member_id)">代充</view>
					</view>
				</view>
				<view class="nidata" v-if="listData.length==0 && !loading">
					<image src="../../static/images/noimg.png"></image>
				</view>
			</view>
		</u-transition>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData: [],
				show:true,
				loading:false,
				search:''
			}
		},
		onShow() {
			// this.getData()
		},
		methods: {
			getData() {
				this.request('/team/getMemberList', {
					search: this.search
				}).then(res => {
					if (res.data.code == 1) {
						this.listData = res.data.data
					}
					this.loading = false;
				})
			},
			btnsearch(){
				this.getData()
			},
			goPage(url){
				uni.navigateTo({
					url:url
				})
			},
		}
	}
</script>

<style lang="scss">
     .content{
		padding-top: 30rpx;
		.shurucon{
			display: flex;
			align-items: center;
			height: 70rpx;
			border: 1rpx solid #ccc;
			border-radius: 10rpx;
			margin: 0 3%;
			.u-icon{
				position: relative;
				top: -1rpx;
				margin-left: 10rpx;
			}
			input{
				width: 90%;
				margin-left: 4rpx;
				font-size:24rpx
			}
			.box_search{
				width: 14%;
				height: 40rpx;
				line-height: 40rpx;
				text-align: center;
				margin: 20rpx 0;
				color: $uni-item-color;
				font-size: 28rpx;
				font-weight: 800;
			}
		}
		.list-con{
			.every{
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 40rpx 3%;
				border-bottom: 1rpx solid #f8f8f8;
				>view{
					&:first-of-type{
						image{
							float: left;
							width: 76rpx;
							height: 76rpx;
							border-radius: 50%;
						}
						>view{
							float: left;
							margin-left: 12rpx;
							view{
								text{
									color: $uni-text-color;
								}
								&:last-of-type{
									font-size: 24rpx;
									color: #999;
									margin-top: 4rpx;
								}
							}
						}
					}
				}
				.cont_a_col{
					width: 120rpx;
					height: 56rpx;
					background: #F7403E;
					border-radius: 56rpx;
					font-size: 28rpx;
					color: #fff;
					text-align: center;
					line-height: 56rpx;
				}
			}
		}
	}
</style>
